home *** CD-ROM | disk | FTP | other *** search
/ Macwelt 1 / Macwelt DVD 1.toast / Web-Publishing / HTML-Editoren / Alpha ƒ / Tcl / SystemCode / CorePackages / internationalMenus.tcl < prev    next >
Encoding:
Text File  |  2001-01-22  |  7.0 KB  |  182 lines

  1. #  AlphaTcl - core Tcl engine
  2. # (auto-install)
  3. alpha::extension internationalMenus 0.3.4 {
  4.     alpha::package require -loose Alpha 7.1.5
  5.     # Menu-replacements (all western keyboards)
  6.     hook::register keyboard intlMenu::standard "Australian"
  7.     hook::register keyboard intlMenu::brasil "Brasil"
  8.     hook::register keyboard intlMenu::standard "British"
  9.     hook::register keyboard intlMenu::canadian_csa "Canadian - CSA"
  10.     hook::register keyboard intlMenu::canadian_iso "Canadian - ISO"
  11.     hook::register keyboard intlMenu::canadian_french "Canadian - French"
  12.     hook::register keyboard intlMenu::danish "Danish"
  13.     hook::register keyboard intlMenu::standard "Dutch"
  14.     hook::register keyboard intlMenu::euro_one "Español - ISO"
  15.     hook::register keyboard intlMenu::euro_one "Finnish"
  16.     hook::register keyboard intlMenu::euro_two "Flemish"
  17.     hook::register keyboard intlMenu::euro_two "French"
  18.     hook::register keyboard intlMenu::euro_two "French - numerical"
  19.     hook::register keyboard intlMenu::euro_one "German"
  20.     hook::register keyboard intlMenu::euro_two "Italian"
  21.     hook::register keyboard intlMenu::euro_one "Norwegian"
  22.     hook::register keyboard intlMenu::roman_jis "Roman - JIS"
  23.     hook::register keyboard intlMenu::spanish "Spanish"
  24.     hook::register keyboard intlMenu::euro_one "Swedish"
  25.     hook::register keyboard intlMenu::swiss "Swiss French"
  26.     hook::register keyboard intlMenu::swiss "Swiss German"
  27.     hook::register keyboard intlMenu::slovencrotian "Slovenian"
  28.     hook::register keyboard intlMenu::slovencrotian "Croatian"
  29.     hook::register keyboard intlMenu::standard "U.S."
  30. } uninstall {this-file} help {
  31.     Changes incompatible menu key-bindings to keys which are useable
  32.     on any (western) international keyboard
  33. }
  34.  
  35. namespace eval intlMenu {}
  36.  
  37. # Define some help procs so we save a lot of typing
  38. proc intlMenu::change_winMenu {zoom zoom_char choose choose_char} {
  39.     menu::replaceWith winMenu [list "//<Szoom" "//<S<I<OdefaultSize" \
  40.       "<S/;chooseAWindow"] \
  41.       items "$zoom_char<Szoom" "$zoom_char<S<I<OdefaultSize" \
  42.       "$choose_char<SchooseAWindow"
  43. }
  44.  
  45. proc intlMenu::change_editMenu {twiddle twiddle_char \
  46.   shiftLeft shiftLeft_char \
  47.   shiftRight shiftRight_char} {
  48.     menu::replaceWith Edit [list "/`<Stwiddle" "/`<S<I<OtwiddleWords"] \
  49.       items "$twiddle_char<Stwiddle" "$twiddle_char<S<I<OtwiddleWords"
  50.     menu::replaceWith Edit [list {/[<SshiftLeft} {/[<S<I<OshiftLeftSpace}] \
  51.       items "$shiftLeft_char<SshiftLeft" "$shiftLeft_char<S<I<OshiftLeftSpace" 
  52.     menu::replaceWith Edit [list {/]<SshiftRight} {/]<S<I<OshiftRightSpace}] \
  53.       items "$shiftRight_char<S<EshiftRight" "$shiftRight_char<S<I<OshiftRightSpace"
  54. }
  55.  
  56. proc intlMenu::change_editMenu_original {} {
  57.     menu::replaceWith Edit [list "/`<Stwiddle" "/`<S<I<OtwiddleWords"] \
  58.       items "/`<Stwiddle" "/`<S<I<OtwiddleWords"
  59.     menu::replaceWith Edit [list {/[<SshiftLeft} {/[<S<I<OshiftLeftSpace}] \
  60.       items {/[<SshiftLeft} {/[<S<I<OshiftLeftSpace} 
  61.     menu::replaceWith Edit [list {/]<SshiftRight} {/]<S<I<OshiftRightSpace}] \
  62.       items {/]<SshiftRight} {/]<S<I<OshiftRightSpace}
  63. }
  64.  
  65. proc intlMenu::change_markHilite {to hilite_char} {
  66.     menu::replaceWith Search "/=markHilite" items "$hilite_char<OmarkHilite"
  67. }
  68.  
  69. proc intlMenu::change_searchMenu {pop pop_char goto goto_char} {
  70.     menu::replaceWith Search [list "/.<BreturnToBookmark" "/G<IgotoLine"] \
  71.       items "$pop_char<BreturnToBookmark" "$goto_char<IgotoLine" 
  72. }
  73.  
  74. proc intlMenu::bindBraces {} {
  75.     Bind '\[' <zs>  normalLeftBrace
  76.     Bind '\]' <zs>  normalRightBrace
  77. }
  78.  
  79. proc intlMenu::unbindBraces {} {
  80.     unBind '\[' <zs>  normalLeftBrace
  81.     unBind '\]' <zs>  normalRightBrace
  82. }
  83.  
  84. # These are the procs which are called automatically when the user chooses 
  85. # one of the (western) international keyboards in the international prefs 
  86. # dialog.
  87. proc intlMenu::brasil {args} {
  88.     intlMenu::change_winMenu zoom "/-" choose "/,"
  89.     intlMenu::change_editMenu twiddle "/<" shiftLeft "" shiftRight ""
  90.     intlMenu::change_markHilite to "/\\"
  91.     intlMenu::change_searchMenu pop "/." goto "/G"
  92.     intlMenu::bindBraces
  93. }
  94.  
  95. proc intlMenu::canadian_csa {args} {
  96.     intlMenu::change_winMenu zoom "//" choose "/;"
  97.     intlMenu::change_editMenu twiddle "" shiftLeft "" shiftRight ""
  98.     intlMenu::change_markHilite to "/="
  99.     intlMenu::change_searchMenu pop "/." goto "/G"
  100.     intlMenu::unbindBraces
  101. }
  102.  
  103. proc intlMenu::canadian_iso {args} {
  104.     intlMenu::change_winMenu zoom "/-" choose "/;"
  105.     intlMenu::change_editMenu twiddle "/<" shiftLeft "" shiftRight ""
  106.     intlMenu::change_markHilite to "/="
  107.     intlMenu::change_searchMenu pop "/." goto "/G"
  108.     intlMenu::unbindBraces
  109. }
  110.  
  111. proc intlMenu::canadian_french {args} {
  112.     intlMenu::change_winMenu zoom "//" choose "/;"
  113.     intlMenu::change_editMenu twiddle "/<" shiftLeft "" shiftRight ""
  114.     intlMenu::change_markHilite to "/="
  115.     intlMenu::change_searchMenu pop "/." goto "/G"
  116.     intlMenu::bindBraces
  117. }
  118.  
  119. proc intlMenu::danish {args} {
  120.     intlMenu::change_winMenu zoom "/-" choose "/,"
  121.     intlMenu::change_editMenu twiddle "/<" shiftLeft "" shiftRight ""
  122.     intlMenu::change_markHilite to "/$"
  123.     intlMenu::change_searchMenu pop "/." goto "/G"
  124.     intlMenu::unbindBraces
  125. }
  126.  
  127. proc intlMenu::euro_one {args} {
  128.     intlMenu::change_winMenu zoom "/-" choose "/,"
  129.     intlMenu::change_editMenu twiddle "/<" shiftLeft "" shiftRight ""
  130.     intlMenu::change_markHilite to ""
  131.     intlMenu::change_searchMenu pop "/." goto "/G"
  132.     intlMenu::unbindBraces
  133. }
  134.  
  135. proc intlMenu::euro_two {args} {
  136.     intlMenu::change_winMenu zoom "/-" choose "/;"
  137.     intlMenu::change_editMenu twiddle "/<" shiftLeft "/(" shiftRight "/)"
  138.     intlMenu::change_markHilite to "/="
  139.     intlMenu::change_searchMenu pop "/:" goto "/G"
  140.     intlMenu::unbindBraces
  141. }
  142.  
  143. proc intlMenu::spanish {args} {
  144.     intlMenu::change_winMenu zoom "/-" choose "/;"
  145.     intlMenu::change_editMenu twiddle "/<" shiftLeft "" shiftRight ""
  146.     intlMenu::change_markHilite to "/="
  147.     intlMenu::change_searchMenu pop "/." goto ""
  148.     intlMenu::unbindBraces
  149. }
  150.  
  151. proc intlMenu::swiss {args} {
  152.     intlMenu::change_winMenu zoom "/-" choose "/,"
  153.     intlMenu::change_editMenu twiddle "/<" shiftLeft "" shiftRight ""
  154.     intlMenu::change_markHilite to "/$"
  155.     intlMenu::change_searchMenu pop "/." goto ""
  156.     intlMenu::unbindBraces
  157. }
  158.  
  159. proc intlMenu::slovencrotian {args} {
  160.     intlMenu::change_winMenu zoom "//" choose "/,"
  161.     intlMenu::change_editMenu twiddle "/<" shiftLeft "" shiftRight ""
  162.     intlMenu::change_markHilite to "/-"
  163.     intlMenu::change_searchMenu pop "/." goto "/G"
  164.     intlMenu::unbindBraces
  165. }
  166.  
  167. proc intlMenu::standard {args} {
  168.     intlMenu::change_winMenu zoom "//" choose "/;"
  169.     intlMenu::change_editMenu_original
  170.     intlMenu::change_markHilite to "/="
  171.     intlMenu::change_searchMenu pop "/." goto "/G"
  172.     intlMenu::bindBraces
  173. }
  174.  
  175. proc intlMenu::roman_jis {args} {
  176.     intlMenu::change_winMenu zoom "//" choose "/;"
  177.     intlMenu::change_editMenu twiddle "/@" shiftLeft "/\[" shiftRight "/\]"
  178.     intlMenu::change_markHilite to "/-"
  179.     intlMenu::change_searchMenu pop "/." goto "/G"
  180.     intlMenu::bindBraces
  181. }
  182.